package com.ihr360.oneclick.vo;

import com.ihr360.oneclick.constant.SpreadsheetRowColumnMeta;
import com.ihr360.oneclick.entity.RowHeaderColumn;

import java.io.Serializable;
import java.util.List;

/**
 * @author tom
 * @date 17-12-27
 */
public class StaffBatchMessageVo implements Serializable {

    private String batchName;

    private String salaryName;

    private String appendedName;

    List<RowCell> rowCellList;


    public String getBatchName() {
        return batchName;
    }

    public void setBatchName(String batchName) {
        this.batchName = batchName;
    }

    public List<RowCell> getRowCellList() {
        return rowCellList;
    }

    public void setRowCellList(List<RowCell> rowCellList) {
        this.rowCellList = rowCellList;
    }

    public String getSalaryName() {
        return salaryName;
    }

    public void setSalaryName(String salaryName) {
        this.salaryName = salaryName;
    }

    public String getAppendedName() {
        return appendedName;
    }

    public void setAppendedName(String appendedName) {
        this.appendedName = appendedName;
    }

    public static class RowCell{
        private String name;

        private Object value;

        public RowCell() {
        }

        public RowCell(String name, Object value) {
            this.name = name;
            this.value = value;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Object getValue() {
            return value;
        }

        public void setValue(Object value) {
            this.value = value;
        }
    }

    public static boolean
    columnFilter(RowHeaderColumn column) {
        if(column == null || column.getColumnFieldMeta() == null) {
            return false;
        }
        return column.getColumnFieldMeta().equals(SpreadsheetRowColumnMeta.STAFF_NAME) ||
                column.getColumnFieldMeta().equals(SpreadsheetRowColumnMeta.MOBILE_NO) ||
                column.getColumnFieldMeta().equals(SpreadsheetRowColumnMeta.IDCARD_NO) ||
                column.getColumnFieldMeta().equals(SpreadsheetRowColumnMeta.IDCARD_TYPE) ||
                column.getColumnFieldMeta().equals(SpreadsheetRowColumnMeta.ENTRY_DATE) ||
                column.getColumnFieldMeta().equals(SpreadsheetRowColumnMeta.MONTH) ||
                column.getColumnFieldMeta().equals(SpreadsheetRowColumnMeta.ALLOW_PUBLISH) ||
                column.getColumnFieldName().equals(SpreadsheetRowColumnMeta.EMAIL_ADDRESS);
    }

}
